﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wechat.Domain;
using Wechat.Dto.Request;
using Wechat.Dto.Response;

namespace Wechat.Dto.Extension
{
    /// <summary>
    /// AutoMapper映射拓展类
    /// </summary>
    public static class MapperExtention
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static WechatImageText ToModel(this WechatImageTextRequest request)
        {
            return AutoMapper.Mapper.Map<WechatImageTextRequest, WechatImageText>(request);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static WechatImageTextResponse ModelTo(this WechatImageText model)
        {
            return AutoMapper.Mapper.Map<WechatImageText, WechatImageTextResponse>(model);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static ReplyMsg ToModel(this ReplyMsgRequest request)
        {
            return AutoMapper.Mapper.Map<ReplyMsgRequest, ReplyMsg>(request);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static ReplyMsgRequest ModelTo(this ReplyMsg model)
        {
            return AutoMapper.Mapper.Map<ReplyMsg, ReplyMsgRequest>(model);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static WechatMemu ToModel(this WechatMemuRequest request)
        {
            return AutoMapper.Mapper.Map<WechatMemuRequest, WechatMemu>(request);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static WechatMemuRequest ModelTo(this WechatMemu model)
        {
            return AutoMapper.Mapper.Map<WechatMemu, WechatMemuRequest>(model);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static WechatAutoReply ToModel(this WechatAutoReplyRequest request)
        {
            return AutoMapper.Mapper.Map<WechatAutoReplyRequest, WechatAutoReply>(request);
        }

    }
}
